package com.yld.car.market;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.yld.car.common.QRCodeUtils;

public class MoreShare2CodeActivity extends BaseActivity {
	public void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.more_share_2code);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);
		((TextView) findViewById(R.id.title)).setText("二维码扫描下载");
		image = (ImageView) findViewById(R.id.my2code);

		new Thread(new Runnable() {

			@Override
			public void run() {
				Bitmap bitmap = QRCodeUtils.createImage();
				Message msg = mHandler.obtainMessage();
				msg.obj = bitmap;
				mHandler.sendMessage(msg);

			}
		}).start();
		showBackButton();

	}

	private ImageView image;

	Handler mHandler = new Handler() {

		public void handleMessage(android.os.Message msg) {

			image.setImageBitmap((Bitmap) msg.obj);

		}
	};
}
